<?php

namespace common\models\myhtsq;

use common\models\BaseModel;

/**
 * Description of DocumentModel
 * 文件model
 * @author wangwx 2015-05-16
 */
class DocumentModel extends BaseModel {

  public $document_id;//文档ID
  public $document_name;//文档名称
  public $document_ext_name;//文档类型
  public $document_path;//存放路径
  public $business_id;//业务ID
  public $created_on;//创建时间
  public $created_by;//创建人
  public $modified_on;//修改时间
  public $modified_by;//修改人
  public $out_file_id;//亿方云ID
  public $creator_id;//创建人ID
  public $recipient_id;//接受人ID
  public $received_by;//接收人名称
  public $received_on;//接收日期
  public $is_sign;//是否签字
  public $contract_code;//合同Code
  public $document_old_name;//文档旧名称
  public $document_new_name;//文档新名称
  public $opportunities_id;//出库单ID
  public $bop_file_type;//附件类型[客户接收单，终端接收单]
  public $document_size;//文档大小
  public $document_group;//文件组类型:0-ERP  1-云客  2-云链  3-云空间
    
    public $invoiceSummarys;

    public function __construct($config = array()) {
        parent::__construct($config);
    }

    public function rules() {
        return [
        	[['created_on', 'modified_on'], 'safe'],
        	[['document_id', 'business_id', 'created_by', 'modified_by'], 'string', 'max' => 36],
        	[['document_name'], 'string', 'max' => 100],
        	[['document_ext_name'], 'string', 'max' => 10],
        	[['document_path'], 'string', 'max' => 500],
            [['created_on', 'received_on'], 'default', 'value' => date('Y-m-d H:i:s')],
            ['document_size','default','value'=>0],
            ['opportunities_id','default','value'=>''],
            ['is_sign','default','value'=>'0']
        ];
    }

}
